<template>
	<view>
		<view>
			<input type="text" v-model="account" placeholder="请输入账号" />
		</view>
		<view>
			<input type="password" v-model="password" placeholder="请输入密码" />
		</view>
		<view>
			<view @click="goregist">注册</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				account: '',
				password:'',
				spread:0,
				
			}
		},
		onLoad(options) {
			if(options){
				this.spread=options.spread
			}
		},
		methods: {
			goregist(){
				console.log('2222222');
				let param={
				account: this.account,
				spread: this.spread,
				captcha: '',
				password: this.password,
			}
				uni.request({
					url:'https://dc.juezee.com/api/register',
					method:'POST',
					data:param
				}).then(res =>{
					console.log(res[1].data)
					if(res[1].data.status==200){
						uni.showToast({
							title:res[1].data.msg,
							icon:"success",
							duration:2000
						})
						uni.navigateTo({
							url:'/pages/components/pages/login'
						})
					}else{
						uni.showToast({
							title:res[1].data.msg,
							icon:"error",
							duration:2000
						})
					}
				})
			}
		}
	}
</script>

<style>
</style>